package model

import "gorm.io/gorm"

type User struct {
	gorm.Model
	Username         string `gorm:"type:varchar(30)" json:"username"`
	Password         string `gorm:"type:varchar(30)" json:"password"`
	AvatarUrl        string `gorm:"type:varchar(30)" json:"avatarUrl"`
	MemberId         int    `gorm:"type:int" json:"memberId"`
	MemberExpireTime int    `gorm:"type:int" json:"memberExpireTime"`
}

func (u *User) IsUser(db *gorm.DB, id int) error {
	return db.Where("id = ?", id).First(&u).Error
}
